<meta charset="UTF-8">
<?php
    if (!empty($_POST['but'])):
        $jc=$_POST['jc'];
        if ($jc==" "||is_numeric($jc)||$jc<0):
             echo "输入的不能看" ;
            endif;
    endif
?>

<form method="post" action="">
    输入阶乘：<input type="text" name="jc"><br>
    <input type="submit" value="提交" name="but">
</form>
